﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bzure.Common.Core;

namespace Bzure.Mvc.Controllers
{
    [MvcControllerFilter("_bzure_filted_controller")]
    public abstract class FiltedController : System.Web.Mvc.Controller
    {
        protected void SetMenuFlag(string MenuFlag)
        {
            List<string> list = this.ViewBag._bzureMvcMenuFlag;
            if (list.IsNullOrEmpty())
            {
                list = new List<string>();
                this.ViewBag._bzureMvcMenuFlag = list;
            }
            list.Add(MenuFlag);
        }
        protected void SetControllerMenus(ControllerMenu[] menus)
        {
            List<ControllerMenu> list = this.ViewBag._bzureControllerMenus;
            if (list.IsNullOrEmpty())
            {
                list = new List<ControllerMenu>();
                this.ViewBag._bzureControllerMenus = list;
            }
            list.AddRange(menus);
        }
    }
}
